import { http } from "@/utils/http";
export function getProductPageList(data: Partial<ShopProductPageRequest & PageRequest>) {
  return http.post<MResponse<Array<ShopProductVo>>>("/product/product/getProductPageList", { data });
}

export function addProduct(data: ShopProductAddRequest) {
  return http.postJson<MResponse>("/product/product/addProduct", { data });
}

export function updateProduct(data: ShopProductUpdateRequest) {
  return http.post<MResponse>("/product/product/updateProduct", { data });
}

export function delProduct(data: ShopProductDelRequest) {
  return http.post<MResponse>("/product/product/delProduct", { data });
}

export function getProductDetail(productId: number) {
  return http.post<MResponse<ShopProductDetailVo>>("/product/product/getProductDetail", {
    data: { productId }
  });
}
